package com.bdzl.api.util;

import com.bdzl.api.entity.PaaSResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author DK
 * @date 2019-10-10 16:02
 * 用于包装接口和原来信息返回一致
 **/
@Component
public class TengxunCloudApiUtils {
    @Autowired
    private TengxunCloudApi tengxunCloudApi;
    public  String idCard(String idCard, String name) {
        String result = "";
        PaaSResponse paaSResponse = tengxunCloudApi.idCard(idCard, name);
        if (paaSResponse != null) {
            switch (paaSResponse.getResult()) {
                case "0":
                    result = "MATCH";
                    break;
                case "-1":
                    result = "MISMATCH";
                    break;
                default:
                    result = "";
            }
        }
        return result;
    }
}
